define(["jquery"], function ($) {
    function UIHandler(opts) {
        var _spd = {
            speed: 100
        };
        $.extend(_spd, opts);
        var target = 0;
        $(".venus-menu").find("li").each(function () {
            if ($(this).children("ul").length > 0) {
                $(this).append("<span class='indicator'>+</span>");
            }
        });

        menuShow();
        $(window).resize(function () {
            menuShow();
        });

        function menuShow() {
            //$(".venus-menu").find("li, a").unbind();
            $(".venus-menu").find("ul").hide(0);
            if (window.innerWidth <= 768) {
                $(".venus-menu").find("ul").removeClass("zoom-out");
            } else {
                $(".venus-menu > li").show(0);
                animation();
            }
        }

        function animation() {
            $(".venus-menu li").bind("mouseover", function () {
                $(this).children("ul").stop(true, true).fadeIn(_spd["speed"]).addClass("zoom-out");
            }).bind("mouseleave", function () {
                $(this).children("ul").stop(true, true).fadeOut(_spd["speed"]).removeClass("zoom-out");
            });
        }
    }

    return {
        startUI: UIHandler
    }
});

